package controllers

import (
	"beego_base_demo/User"
	"fmt"
	"github.com/astaxie/beego"
)

type Reset struct {
	beego.Controller
}

func (this *Reset) Get() {
	oldpasswd:=this.Ctx.Input.Param(":old")
	newpasswd:=this.Ctx.Input.Param(":new")
	acc:=this.Ctx.Input.Param(":acc")
	fmt.Println("acc=",this.Ctx.Input.Param(":acc"))
	fmt.Println("passwd=",this.Ctx.Input.Param(":passwd"))
	ok:=User.Reset(acc,oldpasswd,newpasswd)
	response:="false"
	if ok{
		response="true"
	}
	this.Ctx.WriteString(response)
}




